package exam;

import java.io.*;

public class Test01 {

    public static void main(String[] args) {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                dian();
            }
        });
        t.start();
        System.out.println("评");
    }
    static void dian(){
        System.out.println("点");
    }

    public static void main2(String[] args) {

        FileReader fr = null;
        FileWriter fw = null;
        try {
            fw = new FileWriter("D:\\a.txt");
            fw.write("hello world");
            fw.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {if (fw != null) {
                fw.close();
            }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }


    }

    public static void main1(String[] args) {

        //1.创建输入流对象
        //2.创建输出流对象
        try (InputStreamReader isr = new InputStreamReader(new FileInputStream("要转换的文件路径"));
             OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("转换存入的路径"))) {
            //3.转换
            char[] line = new char[1024];
            int len;//读取的有效长度
            while ((len = isr.read()) != -1) {
                osw.write(line, 0, len);//写入
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
